package com.base.taskreports.reports.service.impl;

import java.math.BigDecimal;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.base.taskreports.common.utlis.TableNameUtil;
import com.base.taskreports.reports.dao.jfs.TblGwTransDetailDao;
import com.base.taskreports.reports.entiyt.jfs.TblGwTransDetailEntity;
import com.base.taskreports.reports.service.TblGwTransDetailService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张玉涛
 * @since 2021-11-09
 */
@DS("jf-gw")
@Service("tblGwTransDetailService")
public class TblGwTransDetailServiceImpl extends ServiceImpl<TblGwTransDetailDao, TblGwTransDetailEntity> implements TblGwTransDetailService {

	/**
     * 积分-用分tbl_cqpnt_point_out_flow01
     */
    public static final String JFYFGW = "tbl_gw_trans_detail_";
    
    @Autowired
    private TblGwTransDetailDao tblGwTransDetailDao;
    //外部积分（转接/兑换）承兑金额浮动告警
	@Override
	public String selectExternalIntegralAcceptanceAmountFloatingAlarm(String dateTime) {
        Map<String, String> dayUtlis = TableNameUtil.dayUtlis(dateTime,JFYFGW);
		//昨天 外部积分（转接/兑换）承兑金额
        Integer currencyPoints  = tblGwTransDetailDao.countAmountFloatingAlarm(
				dayUtlis.get("jfsfzDayTabName"),
				dayUtlis.get("yestoyyyymmddday")
				);
		return currencyPoints !=null ? currencyPoints.toString() :"0";
	}

}
